package com.lzy.system.organization.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lzy.exception.BusException;
import com.lzy.system.organization.dto.SysUserMappingAllocationDTO;
import com.lzy.system.organization.entity.SysRole;
import com.lzy.system.organization.entity.SysUserMapping;
import com.lzy.system.organization.vo.SysUserMappingVo;

import java.util.List;

/**
 * <p>
 * 用户映射 服务类
 * </p>
 *
 * @author lcc
 * @since 2023-11-25
 */
public interface ISysUserMappingService extends IService<SysUserMapping> {
    /**
     * 查询用户列表
     * @param keyword
     * @param company_id
     * @param dep_id
     * @param limit
     * @param page
     * @return
     * @throws BusException
     */
    public IPage<SysUserMappingVo>  getList(String keyword,Long company_id, Long dep_id, long limit, long page) throws BusException ;

    /**
     * 修改
     * @param sysUserMapping
     * @return
     */
    public boolean update (SysUserMapping sysUserMapping) throws BusException;

    /**
     * 清除一个用户的默认身份
     * @param user_id
     * @param id
     * @param status
     * @return
     * @throws BusException
     */
    public boolean updateDef (Long user_id,Long id,Integer status) throws BusException;

    /**
     * 分配人员
     * @param sysUserMappings
     * @return
     * @throws Exception
     */
    public boolean addUser(List<SysUserMappingAllocationDTO> sysUserMappings) throws BusException;

    /**
     * 删除部门下用户对于关系
     * @param sysUserMappings
     * @return
     * @throws BusException
     */
    public boolean delUser(List<SysUserMapping> sysUserMappings) throws BusException;

    /**
     * 设置用户角色
     * @param mid
     * @param sysRoles
     * @return
     * @throws BusException
     */
    public boolean savePower(Long mid,List<SysRole> sysRoles) throws BusException;
}
